package com.snowy.hidden.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.snowy.hidden.user.domain.model.AppletUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 小程序用户信息(AppletUser)表数据库访问层
 *
 * @author h
 * @since 2025-10-21 17:17:15
 */
@Mapper
public interface AppletUserMapper extends BaseMapper<AppletUser>{
    /**
     * 根据openId查询用户信息
     * @param openId
     * @return
     */
    @Select("select * from tb_applet_user where  open_id=#{openId} limit 1")
    AppletUser getByOpenId(@Param("openId")String openId);
    /**
     * 根据手机号查询用户
     * @param phone
     * @return
     */
    @Select("select * from tb_applet_user where phone=#{phone}")
    AppletUser getByPhone(@Param("phone")String phone);

}
